﻿using System;
using Microsoft.AspNetCore.Mvc;
using MsgService.Model;

namespace MsgService.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class EmailController : ControllerBase
    {
        [HttpPost(nameof(Send_QQ))]
        public void Send_QQ(SendEmailRequest sendEmailRequest)
        {
            Console.WriteLine($"通过QQ邮件接口向{sendEmailRequest.Email}发送邮件，标题：{sendEmailRequest.Title}，内容：{sendEmailRequest.Body}");
        }

        [HttpPost(nameof(Send_163))]
        public void Send_163(SendEmailRequest sendEmailRequest)
        {
            Console.WriteLine($"通过163邮件接口向{sendEmailRequest.Email}发送邮件，标题：{sendEmailRequest.Title}，内容：{sendEmailRequest.Body}");
        }

        [HttpPost(nameof(Send_Sohu))]
        public void Send_Sohu(SendEmailRequest sendEmailRequest)
        {
            Console.WriteLine($"通过搜狐邮件接口向{sendEmailRequest.Email}发送邮件，标题：{sendEmailRequest.Title}，内容：{sendEmailRequest.Body}");
        }
    }
}
